// 博客页面组件样式
@use '../variables' as *;
.blog-page {
    min-height: 100vh;
    background-color: #f8fafc;
}

// 主要内容区域样式
.main-content {
    padding-top: 64px;
    min-height: calc(100vh - 64px);
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
}

// 左侧边栏样式
.sidebar {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    .profile-card,
    .contact-card,
    .category-card,
    .tags-card {
        background: white;
        border-radius: $radius-lg;
        padding: 24px;
        box-shadow: $shadow-md;
        border: 1px solid $border-light;
        transition: transform $transition-normal, box-shadow $transition-normal;
        &:hover {
            transform: translateY(-2px);
            box-shadow: $shadow-lg;
        }
    }
    .profile-card {
        text-align: center;
        .profile-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            overflow: hidden;
            margin: 0 auto 16px;
            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
        }
        .profile-name {
            font-size: 20px;
            font-weight: $font-bold;
            color: $text-primary;
            margin: 0 0 8px 0;
        }
        .profile-desc {
            color: $text-secondary;
            margin: 0;
            font-size: 14px;
        }
    }
    .card-title {
        font-size: 16px;
        font-weight: $font-semibold;
        color: $text-primary;
        margin: 0 0 16px 0;
        padding-bottom: 8px;
        border-bottom: 1px solid $border-light;
    }
    .contact-images {
        display: flex;
        gap: 12px;
        justify-content: center;
        .contact-image {
            width: 48px;
            height: 48px;
            border-radius: $radius-md;
            transition: transform $transition-normal;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            position: relative;
            
            &:hover {
                transform: scale(1.1);
            }
            
            img {
                width: 24px;
                height: 24px;
                margin-bottom: 2px;
                filter: brightness(0) invert(1); // 将SVG图标变为白色
            }
            
            .contact-label {
                font-size: 10px;
                color: white;
                font-weight: $font-medium;
            }
            
            &.qq-contact {
                background: linear-gradient(135deg, #12b7f5, #0ea5e9);
                box-shadow: 0 4px 12px rgba(18, 183, 245, 0.3);
                
                &:hover {
                    box-shadow: 0 6px 16px rgba(18, 183, 245, 0.4);
                }
            }
            
            &.wechat-contact {
                background: linear-gradient(135deg, #07c160, #06ad56);
                box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
                
                &:hover {
                    box-shadow: 0 6px 16px rgba(7, 193, 96, 0.4);
                }
            }
            
            &.github-contact {
                background: linear-gradient(135deg, #333, #24292e);
                box-shadow: 0 4px 12px rgba(51, 51, 51, 0.3);
                
                &:hover {
                    box-shadow: 0 6px 16px rgba(51, 51, 51, 0.4);
                }
            }
        }
    }
    .category-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
        .category-group {
            border: 1px solid #e9ecef;
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            &:hover {
                border-color: #667eea;
                box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
            }
            .category-header {
                color: #2c3e50;
                padding: 12px 16px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                font-size: 14px;
                font-weight: 500;
                background: #f8f9fa;
                border-bottom: 1px solid #e9ecef;
                transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                cursor: pointer;
                &:hover {
                    background: #667eea;
                    color: white;
                    .el-icon {
                        color: white;
                    }
                }
                &.active {
                    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                    color: white;
                    font-weight: 600;
                    .el-icon {
                        color: white;
                    }
                }
                .category-title {
                    font-weight: 500;
                    color: inherit;
                    text-decoration: none;
                    cursor: pointer;
                    display: block;
                    flex: 1;
                    padding: 4px 0;
                    -webkit-user-select: none;
                    user-select: none;
                    &:hover {
                        color: inherit;
                    }
                }
                .el-icon {
                    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                    color: #6c757d;
                    &.rotated {
                        transform: rotate(180deg);
                    }
                }
            }
            .subcategory-list {
                background: white;
                max-height: 0;
                overflow: hidden;
                transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                &.active {
                    max-height: 200px;
                    padding: 8px 0;
                }
                .subcategory-item {
                    color: #6c757d;
                    text-decoration: none;
                    padding: 8px 20px;
                    display: block;
                    font-size: 13px;
                    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                    position: relative;
                    cursor: pointer;
                    -webkit-user-select: none;
                    user-select: none;
                    &:hover {
                        background: rgba(102, 126, 234, 0.05);
                        color: #667eea;
                        padding-left: 24px;
                    }
                    &.router-link-active {
                        background: rgba(102, 126, 234, 0.1);
                        color: #667eea;
                        font-weight: 500;
                    }
                    &::before {
                        content: '•';
                        position: absolute;
                        left: 12px;
                        color: #adb5bd;
                        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                    }
                    &:hover::before {
                        color: #667eea;
                    }
                }
            }
        }
    }
    .tags-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        .tag-item {
            color: #2c3e50;
            text-decoration: none;
            padding: 8px 16px;
            border-radius: 20px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-size: 13px;
            font-weight: 500;
            background: #f8f9fa;
            border: 2px solid #e9ecef;
            position: relative;
            overflow: hidden;
            cursor: pointer;
            -webkit-user-select: none;
            user-select: none;
            &::before {
                content: '';
                position: absolute;
                top: 0;
                left: -100%;
                width: 100%;
                height: 100%;
                background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
                transition: left 0.5s;
            }
            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
                border-color: #667eea;
                color: #667eea;
                background: #ffffff;
                &::before {
                    left: 100%;
                }
            }
            &.active {
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                border-color: #667eea;
                color: white;
                box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
                &:hover {
                    transform: translateY(-2px);
                    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
                }
            }
            // 不同标签使用不同的主题色
            &:nth-child(1) {
                &:hover {
                    border-color: #667eea;
                    color: #667eea;
                }
            }
            &:nth-child(2) {
                &:hover {
                    border-color: #4facfe;
                    color: #4facfe;
                }
            }
            &:nth-child(3) {
                &:hover {
                    border-color: #43e97b;
                    color: #43e97b;
                }
            }
            &:nth-child(4) {
                &:hover {
                    border-color: #fa709a;
                    color: #fa709a;
                }
            }
            &:nth-child(5) {
                &:hover {
                    border-color: #f093fb;
                    color: #f093fb;
                }
            }
        }
    }
}

// 主内容区域样式
.content-area {
    .blog-list {
        display: flex;
        flex-direction: column;
        gap: 24px;
        margin-bottom: 40px;
    }
    .blog-item {
        background: white;
        border-radius: $radius-lg;
        padding: 0;
        box-shadow: $shadow-md;
        border: 1px solid $border-light;
        transition: all $transition-normal;
        overflow: hidden;
        display: flex;
        min-height: 200px;
        &:hover {
            transform: translateY(-2px);
            box-shadow: $shadow-lg;
            border-color: rgba($accent-color, 0.2);
        }
        // 博客展示图片样式
        .blog-image {
            flex: 0 0 300px;
            position: relative;
            overflow: hidden;
            &.image-first {
                order: 1;
            }
            &.image-last {
                order: 3;
            }
            .image-container {
                width: 100%;
                height: 100%;
                position: relative;
                overflow: hidden;
                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    transition: transform $transition-normal;
                }
            }
            // 斜形切割效果
            &.image-first .image-container img {
                clip-path: polygon(0 0, 85% 0, 100% 100%, 0% 100%);
            }
            &.image-last .image-container img {
                clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%);
            }
        }
        &:hover .blog-image .image-container img {
            transform: scale(1.05);
        }
        .blog-content {
            flex: 1;
            padding: 32px;
            cursor: pointer; // 添加鼠标指针样式，表示可点击
            &.content-first {
                order: 2;
            }
            &.content-last {
                order: 1;
            }
            .blog-title {
                font-size: 24px;
                font-weight: $font-bold;
                color: $text-primary;
                margin: 0 0 16px 0;
                line-height: 1.3;
                transition: color $transition-normal;
                &:hover {
                    color: $accent-color;
                }
            }
            .blog-intro {
                color: $text-secondary;
                line-height: 1.6;
                margin: 0 0 20px 0;
                font-size: 16px;
            }
            .blog-meta {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding-top: 16px;
                border-top: 1px solid $border-light;
                .blog-date {
                    color: $text-muted;
                    font-size: 14px;
                }
                .blog-actions {
                    .like-btn {
                        display: flex;
                        align-items: center;
                        gap: 6px;
                        padding: 8px 16px;
                        border-radius: $radius-md;
                        border: 1px solid $border-color;
                        background: white;
                        color: $text-secondary;
                        cursor: pointer;
                        transition: all $transition-normal;
                        font-size: 14px;
                        &:hover {
                            border-color: $accent-color;
                            color: $accent-color;
                        }
                        &.liked {
                            background: rgba($accent-color, 0.1);
                            border-color: $accent-color;
                            color: $accent-color;
                            .el-icon {
                                color: #e53e3e;
                            }
                        }
                        .like-count {
                            font-weight: $font-medium;
                        }
                    }
                }
            }
        }
    }
    .pagination-wrapper {
        display: flex;
        justify-content: center;
        padding: 20px 0;
         :deep(.el-pagination) {
            .el-pager li {
                border-radius: $radius-md;
                transition: all $transition-normal;
                &:hover {
                    background-color: rgba($accent-color, 0.1);
                    color: $accent-color;
                }
                &.is-active {
                    background-color: $accent-color;
                    color: white;
                }
            }
            .btn-prev,
            .btn-next {
                border-radius: $radius-md;
                transition: all $transition-normal;
                &:hover {
                    background-color: rgba($accent-color, 0.1);
                    color: $accent-color;
                }
            }
        }
    }
}

// 响应式设计
@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 280px 1fr;
        gap: 30px;
    }
    .header .search-box .search-input {
        width: 250px;
    }
}

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    .header {
        .search-box {
            display: none;
        }
        .nav-menu {
            gap: 20px;
        }
    }
}

@media (max-width: 768px) {
    .header {
        .nav-menu {
            display: none;
        }
    }
    .content-wrapper {
        padding: 20px 15px;
    }
    .blog-item {
        flex-direction: column;
        .blog-image {
            flex: 0 0 200px;
            order: 1 !important;
            .image-container img {
                clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%) !important;
            }
        }
        .blog-content {
            order: 2 !important;
            padding: 24px;
            .blog-title {
                font-size: 20px;
            }
        }
    }
    .sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .blog-item {
        .blog-image {
            flex: 0 0 150px;
        }
        .blog-content {
            padding: 20px;
            .blog-title {
                font-size: 18px;
            }
            .blog-intro {
                font-size: 14px;
            }
            .blog-meta {
                flex-direction: column;
                gap: 12px;
                align-items: flex-start;
            }
        }
    }
}

// 示例数据提示样式
.sample-data-notice {
    margin-bottom: 24px;
    
    .el-alert {
        border-radius: $radius-lg;
        border: 1px solid rgba($accent-color, 0.2);
        background: linear-gradient(135deg, rgba($accent-color, 0.05) 0%, rgba($accent-color, 0.02) 100%);
        
        .el-alert__title {
            font-weight: $font-semibold;
            color: $accent-color;
        }
        
        .el-alert__description {
            color: $text-secondary;
            font-size: 14px;
            line-height: 1.5;
        }
        
        .el-alert__icon {
            color: $accent-color;
        }
    }
}